<?php $banners = $this->requestAction('/banners/banners');
$i = 0;
foreach ($banners as $banner):
	
	if ($i % 2 == 0) {
            $class = '';
	}
        else
        {
            $class = 'last';
        }
        
?>
<div class="banner_home <?php echo $class; ?>">
    <?php 
    
        if($filetype->getFile($banner['Banner']['filename'])=='swf')
        {
                echo $flash->renderSwf('/files/banners/'.$this->data['Banner']['filename'],250,120);
        }
        else
        {
                if($banner['Banner']['link']=="")
                {
                    echo $html->image('/files/banners/'.$banner['Banner']['filename'],array('width'=>250,'height'=>120,'alt'=>$banner['Banner']['nombre_banner'],'title'=>$banner['Banner']['nombre_banner']));
                }
                else
                {
                     echo $html->link( $html->image('/files/banners/'.$banner['Banner']['filename'],array('width'=>250,'height'=>120,'alt'=>$banner['Banner']['nombre_banner'],'title'=>$banner['Banner']['nombre_banner'])),'http://'.$banner['Banner']['link'],array('escape'=>false,'target'=>'_blank','rel'=>'nofollow') );
                }
        }

         ?>
</div>
<?php
$i++;
endforeach;
if(!count($banners)):
?>
    <div class="banner_home"><?php echo $html->image('banner250x120.jpg'); ?></div>
    <div class="banner_home last"><?php echo $html->image('banner250x120.jpg'); ?></div>
    <div class="banner_home"><?php echo $html->image('banner250x120.jpg'); ?></div>
    <div class="banner_home last"><?php echo $html->image('banner250x120.jpg'); ?></div>
<?php endif; ?>